package com.iis.hrms.persistence;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * The persistent class for the overtime_rules database table.
 */
@Entity
@Table(name = "overtime_rules")
@NamedQueries({
        @NamedQuery(name = "OvertimeRules.findAll", query = "SELECT o FROM OvertimeRules o"),
        @NamedQuery(name = "OvertimeRules.findById", query = "SELECT o FROM OvertimeRules o WHERE o.id = :id"),
        @NamedQuery(name = "OvertimeRules.findByDescription", query = "SELECT o FROM OvertimeRules o WHERE o.description = :description"),
        @NamedQuery(name = "OvertimeRules.findByOfficeHour", query = "SELECT o FROM OvertimeRules o WHERE o.officeHour = :officeHour"),
        @NamedQuery(name = "OvertimeRules.findBySaturday", query = "SELECT o FROM OvertimeRules o WHERE o.saturday = :saturday"),
        @NamedQuery(name = "OvertimeRules.findBySunday", query = "SELECT o FROM OvertimeRules o WHERE o.sunday = :sunday"),
        @NamedQuery(name = "OvertimeRules.findByHoliday", query = "SELECT o FROM OvertimeRules o WHERE o.holiday = :holiday")})
public class OvertimeRules implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(unique = true, nullable = false)
    private String id;

    @Column(nullable = false, length = 255)
    private String description;

    @Column(nullable = false, precision = 10, scale = 2)
    private BigDecimal holiday;

    @Column(name = "office_hour", nullable = false, precision = 10, scale = 2)
    private BigDecimal officeHour;

    @Column(nullable = false, precision = 10, scale = 2)
    private BigDecimal saturday;

    @Column(nullable = false, precision = 10, scale = 2)
    private BigDecimal sunday;

    // bi-directional many-to-one association to Employee
    @OneToMany(mappedBy = "overtimeRule")
    private List<Employee> employees;

    public OvertimeRules() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public BigDecimal getHoliday() {
        return this.holiday;
    }

    public void setHoliday(BigDecimal holiday) {
        this.holiday = holiday;
    }

    public BigDecimal getOfficeHour() {
        return this.officeHour;
    }

    public void setOfficeHour(BigDecimal officeHour) {
        this.officeHour = officeHour;
    }

    public BigDecimal getSaturday() {
        return this.saturday;
    }

    public void setSaturday(BigDecimal saturday) {
        this.saturday = saturday;
    }

    public BigDecimal getSunday() {
        return this.sunday;
    }

    public void setSunday(BigDecimal sunday) {
        this.sunday = sunday;
    }

    public List<Employee> getEmployees() {
        return this.employees;
    }

    public void setEmployees(List<Employee> employees) {
        this.employees = employees;
    }

}